import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// import moment from 'moment/moment'
import { Button, Swipe, SwipeItem, Tabbar, TabbarItem, Icon, NavBar, Field, Cell, CellGroup, Toast } from 'vant'
import VuePreview from 'vue-preview'

Vue.use(Swipe).use(SwipeItem).use(Button).use(Tabbar).use(TabbarItem).use(Icon).use(NavBar).use(Field).use(Cell).use(CellGroup).use(Toast).use(VuePreview)
Vue.config.productionTip = false

// 全局时间过滤器
Vue.filter('dateFormat', function (dateStr) {
  var dt = new Date(dateStr)
  var y = dt.getFullYear()
  var m = dt.getMonth() + 1
  var d = dt.getDate()
  return `${y}-${m}-${d}`
})

/* eslint-disable no-new */

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
